package com.etbsms.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "Code_Plant")
public class CodePlant implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3269027513128330788L;

	private String code;
	private String name_en;
	private String name_ch;
	private CodePlant parent;
	private String parent_code;
	private boolean hide = false;
	private boolean selected = false;
	
	
	@Id 
	@Column(name = "code" ,nullable = false)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "assigned")  
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	
	@Column(name = "name_en" ,nullable = true, length = 256)
	public String getName_en() {
		return name_en;
	}
	public void setName_en(String name_en) {
		this.name_en = name_en;
	}
	
	@Column(name = "name_ch" ,nullable = true, length = 256)
	public String getName_ch() {
		return name_ch;
	}
	public void setName_ch(String name_ch) {
		this.name_ch = name_ch;
	}
	
	@ManyToOne
	@JoinColumn(name="CodePlant_seqNo",nullable = true)
	public CodePlant getParent() {
		return parent;
	}
	public void setParent(CodePlant parent) {
		this.parent = parent;
	}
	
	@Transient
	public boolean isHide() {
		return hide;
	}
	public void setHide(boolean hide) {
		this.hide = hide;
	}
	
	@Transient
	public boolean isSelected() {
		return selected;
	}
	public void setSelected(boolean selected) {
		this.selected = selected;
	}
	
	@Transient
	public String getParent_code() {
		return parent_code;
	}
	public void setParent_code(String parent_code) {
		this.parent_code = parent_code;
	}
}
